<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the bindSecure method from the HttpServer class, for the Dart programming language.">
  <title>bindSecure method - HttpServer class - dart:io library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="../..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">
  
</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">shake</a></li>
    <li><a href="dart-io/dart-io-library.html">dart:io</a></li>
    <li><a href="dart-io/HttpServer-class.html">HttpServer</a></li>
    <li class="self-crumb">bindSecure method</li>
  </ol>
  <div class="self-name">bindSecure</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div id="dartdoc-sidebar-left" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <header id="header-search-sidebar" class="hidden-l">
      <form class="search-sidebar" role="search">
        <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
      </form>
    </header>
    
    <ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
      <li><a href="index.html">shake</a></li>
      <li><a href="dart-io/dart-io-library.html">dart:io</a></li>
      <li><a href="dart-io/HttpServer-class.html">HttpServer</a></li>
      <li class="self-crumb">bindSecure method</li>
    </ol>
    
    <h5>HttpServer class</h5>
    <ol>
      <li class="section-title"><a href="dart-io/HttpServer-class.html#constructors">Constructors</a></li>
      <li><a href="dart-io/HttpServer/HttpServer.listenOn.html">listenOn</a></li>
    
      <li class="section-title">
        <a href="dart-io/HttpServer-class.html#instance-properties">Properties</a>
      </li>
      <li><a href="dart-io/HttpServer/address.html">address</a></li>
      <li><a href="dart-io/HttpServer/autoCompress.html">autoCompress</a></li>
      <li><a href="dart-io/HttpServer/defaultResponseHeaders.html">defaultResponseHeaders</a></li>
      <li><a href="dart-io/HttpServer/idleTimeout.html">idleTimeout</a></li>
      <li><a href="dart-io/HttpServer/port.html">port</a></li>
      <li><a href="dart-io/HttpServer/serverHeader.html">serverHeader</a></li>
      <li><a href="dart-io/HttpServer/sessionTimeout.html">sessionTimeout</a></li>
      <li class="inherited"><a href="dart-async/Stream/first.html">first</a></li>
      <li class="inherited"><a href="dart-core/Object/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="dart-async/Stream/isBroadcast.html">isBroadcast</a></li>
      <li class="inherited"><a href="dart-async/Stream/isEmpty.html">isEmpty</a></li>
      <li class="inherited"><a href="dart-async/Stream/last.html">last</a></li>
      <li class="inherited"><a href="dart-async/Stream/length.html">length</a></li>
      <li class="inherited"><a href="dart-core/Object/runtimeType.html">runtimeType</a></li>
      <li class="inherited"><a href="dart-async/Stream/single.html">single</a></li>
    
      <li class="section-title"><a href="dart-io/HttpServer-class.html#instance-methods">Methods</a></li>
      <li><a href="dart-io/HttpServer/close.html">close</a></li>
      <li><a href="dart-io/HttpServer/connectionsInfo.html">connectionsInfo</a></li>
      <li class="inherited"><a href="dart-async/Stream/any.html">any</a></li>
      <li class="inherited"><a href="dart-async/Stream/asBroadcastStream.html">asBroadcastStream</a></li>
      <li class="inherited"><a href="dart-async/Stream/asyncExpand.html">asyncExpand</a></li>
      <li class="inherited"><a href="dart-async/Stream/asyncMap.html">asyncMap</a></li>
      <li class="inherited"><a href="dart-async/Stream/cast.html">cast</a></li>
      <li class="inherited"><a href="dart-async/Stream/contains.html">contains</a></li>
      <li class="inherited"><a href="dart-async/Stream/distinct.html">distinct</a></li>
      <li class="inherited"><a href="dart-async/Stream/drain.html">drain</a></li>
      <li class="inherited"><a href="dart-async/Stream/elementAt.html">elementAt</a></li>
      <li class="inherited"><a href="dart-async/Stream/every.html">every</a></li>
      <li class="inherited"><a href="dart-async/Stream/expand.html">expand</a></li>
      <li class="inherited"><a href="dart-async/Stream/firstWhere.html">firstWhere</a></li>
      <li class="inherited"><a href="dart-async/Stream/fold.html">fold</a></li>
      <li class="inherited"><a href="dart-async/Stream/forEach.html">forEach</a></li>
      <li class="inherited"><a href="dart-async/Stream/handleError.html">handleError</a></li>
      <li class="inherited"><a href="dart-async/Stream/join.html">join</a></li>
      <li class="inherited"><a href="dart-async/Stream/lastWhere.html">lastWhere</a></li>
      <li class="inherited"><a href="dart-async/Stream/listen.html">listen</a></li>
      <li class="inherited"><a href="dart-async/Stream/map.html">map</a></li>
      <li class="inherited"><a href="dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="dart-async/Stream/pipe.html">pipe</a></li>
      <li class="inherited"><a href="dart-async/Stream/reduce.html">reduce</a></li>
      <li class="inherited"><a href="dart-async/Stream/singleWhere.html">singleWhere</a></li>
      <li class="inherited"><a href="dart-async/Stream/skip.html">skip</a></li>
      <li class="inherited"><a href="dart-async/Stream/skipWhile.html">skipWhile</a></li>
      <li class="inherited"><a href="dart-async/Stream/take.html">take</a></li>
      <li class="inherited"><a href="dart-async/Stream/takeWhile.html">takeWhile</a></li>
      <li class="inherited"><a href="dart-async/Stream/timeout.html">timeout</a></li>
      <li class="inherited"><a href="dart-async/Stream/toList.html">toList</a></li>
      <li class="inherited"><a href="dart-async/Stream/toSet.html">toSet</a></li>
      <li class="inherited"><a href="dart-core/Object/toString.html">toString</a></li>
      <li class="inherited"><a href="dart-async/Stream/transform.html">transform</a></li>
      <li class="inherited"><a href="dart-async/Stream/where.html">where</a></li>
    
      <li class="section-title inherited"><a href="dart-io/HttpServer-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="dart-core/Object/operator_equals.html">operator ==</a></li>
    
    
      <li class="section-title"><a href="dart-io/HttpServer-class.html#static-methods">Static methods</a></li>
      <li><a href="dart-io/HttpServer/bind.html">bind</a></li>
      <li><a href="dart-io/HttpServer/bindSecure.html">bindSecure</a></li>
    
    </ol>
  </div><!--/.sidebar-offcanvas-->

  <div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
      <div><h1>bindSecure method</h1></div>

    <section class="multi-line-signature">
      <span class="returntype"><a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="dart-io/HttpServer-class.html">HttpServer</a></span>&gt;</span></span>
            <span class="name ">bindSecure</span>
(<wbr><span class="parameter" id="bindSecure-param-address"><span class="type-annotation">dynamic</span> <span class="parameter-name">address</span>, </span> <span class="parameter" id="bindSecure-param-port"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">port</span>, </span> <span class="parameter" id="bindSecure-param-context"><span class="type-annotation"><a href="dart-io/SecurityContext-class.html">SecurityContext</a></span> <span class="parameter-name">context</span>, {</span> <span class="parameter" id="bindSecure-param-backlog"><span class="type-annotation"><a href="dart-core/int-class.html">int</a></span> <span class="parameter-name">backlog</span>: <span class="default-value">0</span>, </span> <span class="parameter" id="bindSecure-param-v6Only"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">v6Only</span>: <span class="default-value">false</span>, </span> <span class="parameter" id="bindSecure-param-requestClientCertificate"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">requestClientCertificate</span>: <span class="default-value">false</span>, </span> <span class="parameter" id="bindSecure-param-shared"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">shared</span>: <span class="default-value">false</span></span> })
      
    </section>
    <section class="desc markdown">
      <p>The <code>address</code> can either be a <a href="dart-core/String-class.html">String</a> or an
<a href="dart-io/InternetAddress-class.html">InternetAddress</a>. If <code>address</code> is a <a href="dart-core/String-class.html">String</a>, <a href="dart-io/HttpServer/bind.html">bind</a> will
perform a <a href="dart-io/InternetAddress/lookup.html">InternetAddress.lookup</a> and use the first value in the
list. To listen on the loopback adapter, which will allow only
incoming connections from the local host, use the value
<a href="dart-io/InternetAddress/loopbackIPv4.html">InternetAddress.loopbackIPv4</a> or
<a href="dart-io/InternetAddress/loopbackIPv6.html">InternetAddress.loopbackIPv6</a>. To allow for incoming
connection from the network use either one of the values
<a href="dart-io/InternetAddress/anyIPv4.html">InternetAddress.anyIPv4</a> or <a href="dart-io/InternetAddress/anyIPv6.html">InternetAddress.anyIPv6</a> to
bind to all interfaces or the IP address of a specific interface.</p>
<p>If an IP version 6 (IPv6) address is used, both IP version 6
(IPv6) and version 4 (IPv4) connections will be accepted. To
restrict this to version 6 (IPv6) only, use <code>v6Only</code> to set
version 6 only.</p>
<p>If <code>port</code> has the value <code>0</code> an ephemeral port will be chosen by
the system. The actual port used can be retrieved using the
<code>port</code> getter.</p>
<p>The optional argument <code>backlog</code> can be used to specify the listen
backlog for the underlying OS listen setup. If <code>backlog</code> has the
value of <code>0</code> (the default) a reasonable value will be chosen by
the system.</p>
<p>If <code>requestClientCertificate</code> is true, the server will
request clients to authenticate with a client certificate.
The server will advertise the names of trusted issuers of client
certificates, getting them from a <a href="dart-io/SecurityContext-class.html">SecurityContext</a>, where they have been
set using <a href="dart-io/SecurityContext/setClientAuthorities.html">SecurityContext.setClientAuthorities</a>.</p>
<p>The optional argument <code>shared</code> specifies whether additional HttpServer
objects can bind to the same combination of <code>address</code>, <code>port</code> and <code>v6Only</code>.
If <code>shared</code> is <code>true</code> and more <code>HttpServer</code>s from this isolate or other
isolates are bound to the port, then the incoming connections will be
distributed among all the bound <code>HttpServer</code>s. Connections can be
distributed over multiple isolates this way.</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">static Future&lt;HttpServer&gt; bindSecure(
        address, int port, SecurityContext context,
        {int backlog: 0,
        bool v6Only: false,
        bool requestClientCertificate: false,
        bool shared: false}) =&gt;
    _HttpServer.bindSecure(address, port, context, backlog, v6Only,
        requestClientCertificate, shared);</code></pre>
    </section>

  </div> <!-- /.main-content -->

  <div id="dartdoc-sidebar-right" class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    shake 0.1.0
  </span>

  
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
